Various tools have been used to launch code from a calling module in a host environment and actually execute the code in a remote environment. A remote environment refers to an environment that is remote from the host environment from which the call came, so that the host environment and the remote environment are in different computing sessions. Accordingly, the host and remote environments may be different real machines, different virtual machines, different user sessions, etc. For example, the remote environment may be a virtual machine that is hosted by the host environment, where the host environment is a non-virtual session in a physical machine. In some of these remote execution tools, the code to be executed (and possibly an agent to manage the execution) is pre-copied into the remote environment before the calling module requests that the tool remotely run the code. Other tools copy both the code to execute and an agent to run the code into the remote environment after receiving the request from the calling module, but the code is executed in a new separate process in the context of a current user of the host environment, so that the user of the host environment typically has to have administrative rights in the remote environment.